package serviceimpl;

import mapper.OrderMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import po.Order;
import service.OrderService;

import java.util.List;

/**
 * Created by apple on 2017/10/21.
 */

@Component
public class OrderServiceImpl implements OrderService {

    @Autowired
    private OrderMapper orderMapper;

    @Override
    public boolean createOrderInfo(Order order) {
        return orderMapper.insertOrder(order);
    }

    @Override
    public boolean deleteOrderInfo(Order order) {
        return orderMapper.deleteOrderById(order.getOrderid());
    }

    @Override
    public List<Order> selectOrderInfo(String username) {
        return orderMapper.selectOrderByUsername(username);
    }

    @Override
    public List<Order> selectAllOrders() {
        return orderMapper.selectAllOrders();
    }
}
